﻿@model Weapsy.Reporting.EmailAccounts.EmailAccountModel

@{
    ViewBag.Title = "Edit Email Account";
}

@section scripts {
    @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
    <script src="~/js/admin/emailAccounts/shared.js"></script>
    <script src="~/js/admin/emailAccounts/edit.js"></script>   
}

<div class="page-header">
    <h1>Edit Email Account</h1>
</div>

<form id="editEmailAccountForm" name="editEmailAccountForm" data-ajax="true" data-ajax-method="PUT" data-ajax-url="api/emailAccount" data-ajax-loading="#savingEmailAccount" class="form-horizontal validate-form" role="form">
    <input type="hidden" id="id" name="id" value="@Model.Id" />

    @await Html.PartialAsync("_EmailAccount")

    <div class="form-group">
        <div class="col-md-offset-2 col-md-10">
            <button id="save" type="submit" class="btn btn-primary" title="Save">Save</button>
            <a id="deleteEmailAccount" class="btn btn-danger" data-toggle="modal" data-target="#confirm-delete" title="Delete">Delete</a>
            <a href="@Url.Action("Index", "EmailAccount", new { area = "Admin" })" class="btn btn-default" title="Cancel">Cancel</a>
        </div>
    </div>

    <div class="form-group">
        <div class="col-md-offset-2 col-md-10">
            <span id="savingEmailAccount" style="display:none;">
                Saving...
            </span>
        </div>
    </div>
</form>

@await Html.PartialAsync("_ConfirmDelete")